.class Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;
.super Ljava/lang/Object;
.source "AccountRegister.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/netease/newsreader/activity/AccountRegister;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "RegisterHandler"
.end annotation


# instance fields
.field final synthetic this$0:Lcom/netease/newsreader/activity/AccountRegister;


# direct methods
.method constructor <init>(Lcom/netease/newsreader/activity/AccountRegister;)V
    .locals 0
    .parameter

    .prologue
    .line 227
    iput-object p1, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 15

    .prologue
    .line 231
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    iget-object v13, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    invoke-static {v13}, Lcom/netease/newsreader/activity/AccountRegister;->access$0(Lcom/netease/newsreader/activity/AccountRegister;)Landroid/widget/EditText;

    move-result-object v13

    invoke-virtual {v13}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v13

    invoke-interface {v13}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v13

    invoke-static {v12, v13}, Lcom/netease/newsreader/activity/AccountRegister;->access$1(Lcom/netease/newsreader/activity/AccountRegister;Ljava/lang/String;)V

    .line 232
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    iget-object v13, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    invoke-static {v13}, Lcom/netease/newsreader/activity/AccountRegister;->access$2(Lcom/netease/newsreader/activity/AccountRegister;)Landroid/widget/EditText;

    move-result-object v13

    invoke-virtual {v13}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v13

    invoke-interface {v13}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v13

    invoke-static {v12, v13}, Lcom/netease/newsreader/activity/AccountRegister;->access$3(Lcom/netease/newsreader/activity/AccountRegister;Ljava/lang/String;)V

    .line 233
    const/4 v6, 0x0

    .line 235
    .local v6, regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    :try_start_0
    new-instance v2, Lorg/apache/http/client/methods/HttpPost;

    const-string v12, "http://c.3g.163.com/urs/reg"

    invoke-direct {v2, v12}, Lorg/apache/http/client/methods/HttpPost;-><init>(Ljava/lang/String;)V

    .line 237
    .local v2, httpRequest:Lorg/apache/http/client/methods/HttpPost;
    new-instance v4, Ljava/util/ArrayList;

    invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V

    .line 238
    .local v4, params:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    new-instance v12, Lorg/apache/http/message/BasicNameValuePair;

    const-string v13, "username"

    iget-object v14, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    invoke-static {v14}, Lcom/netease/newsreader/activity/AccountRegister;->access$8(Lcom/netease/newsreader/activity/AccountRegister;)Ljava/lang/String;

    move-result-object v14

    invoke-direct {v12, v13, v14}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v4, v12}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 239
    new-instance v12, Lorg/apache/http/message/BasicNameValuePair;

    const-string v13, "password"

    iget-object v14, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    invoke-static {v14}, Lcom/netease/newsreader/activity/AccountRegister;->access$9(Lcom/netease/newsreader/activity/AccountRegister;)Ljava/lang/String;

    move-result-object v14

    invoke-direct {v12, v13, v14}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v4, v12}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 242
    new-instance v12, Lorg/apache/http/client/entity/UrlEncodedFormEntity;

    const-string v13, "UTF-8"

    invoke-direct {v12, v4, v13}, Lorg/apache/http/client/entity/UrlEncodedFormEntity;-><init>(Ljava/util/List;Ljava/lang/String;)V

    invoke-virtual {v2, v12}, Lorg/apache/http/client/methods/HttpPost;->setEntity(Lorg/apache/http/HttpEntity;)V

    .line 244
    new-instance v1, Lorg/apache/http/params/BasicHttpParams;

    invoke-direct {v1}, Lorg/apache/http/params/BasicHttpParams;-><init>()V

    .line 247
    .local v1, httpParameters:Lorg/apache/http/params/HttpParams;
    const v10, 0xea60

    .line 248
    .local v10, timeoutConnection:I
    invoke-static {v1, v10}, Lorg/apache/http/params/HttpConnectionParams;->setConnectionTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 251
    const v11, 0xea60

    .line 252
    .local v11, timeoutSocket:I
    invoke-static {v1, v11}, Lorg/apache/http/params/HttpConnectionParams;->setSoTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 253
    new-instance v7, Lorg/apache/http/impl/client/DefaultHttpClient;

    invoke-direct {v7, v1}, Lorg/apache/http/impl/client/DefaultHttpClient;-><init>(Lorg/apache/http/params/HttpParams;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 255
    .end local v6           #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .local v7, regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    :try_start_1
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    invoke-static {v12}, Lcom/netease/newsreader/util/Tools;->isCMWAPMobileNet(Landroid/content/Context;)Z

    move-result v12

    if-eqz v12, :cond_0

    .line 256
    new-instance v5, Lorg/apache/http/HttpHost;

    const-string v12, "10.0.0.172"

    const/16 v13, 0x50

    const-string v14, "http"

    invoke-direct {v5, v12, v13, v14}, Lorg/apache/http/HttpHost;-><init>(Ljava/lang/String;ILjava/lang/String;)V

    .line 257
    .local v5, proxy:Lorg/apache/http/HttpHost;
    invoke-virtual {v7}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v12

    const-string v13, "http.route.default-proxy"

    invoke-interface {v12, v13, v5}, Lorg/apache/http/params/HttpParams;->setParameter(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/http/params/HttpParams;

    .line 259
    .end local v5           #proxy:Lorg/apache/http/HttpHost;
    :cond_0
    invoke-virtual {v7, v2}, Lorg/apache/http/impl/client/DefaultHttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v3

    .line 261
    .local v3, httpResponse:Lorg/apache/http/HttpResponse;
    invoke-interface {v3}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine;

    move-result-object v12

    invoke-interface {v12}, Lorg/apache/http/StatusLine;->getStatusCode()I

    move-result v12

    const/16 v13, 0xc8

    if-ne v12, v13, :cond_7

    .line 263
    invoke-interface {v3}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v12

    invoke-static {v12}, Lorg/apache/http/util/EntityUtils;->toString(Lorg/apache/http/HttpEntity;)Ljava/lang/String;

    move-result-object v9

    .line 265
    .local v9, status:Ljava/lang/String;
    const/4 v12, 0x0

    const/4 v13, 0x3

    invoke-virtual {v9, v12, v13}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v8

    .line 267
    .local v8, resultString:Ljava/lang/String;
    const-string v12, "200"

    invoke-virtual {v12, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v12

    if-eqz v12, :cond_3

    .line 268
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    const/4 v13, 0x1

    invoke-static {v12, v13}, Lcom/netease/newsreader/activity/AccountRegister;->access$10(Lcom/netease/newsreader/activity/AccountRegister;Z)V

    .line 269
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    iget-object v12, v12, Lcom/netease/newsreader/activity/AccountRegister;->registerHandler:Landroid/os/Handler;

    const/4 v13, 0x5

    invoke-virtual {v12, v13}, Landroid/os/Handler;->sendEmptyMessage(I)Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 290
    .end local v8           #resultString:Ljava/lang/String;
    .end local v9           #status:Ljava/lang/String;
    :goto_0
    if-eqz v7, :cond_1

    .line 291
    invoke-virtual {v7}, Lorg/apache/http/impl/client/DefaultHttpClient;->getConnectionManager()Lorg/apache/http/conn/ClientConnectionManager;

    move-result-object v12

    invoke-interface {v12}, Lorg/apache/http/conn/ClientConnectionManager;->shutdown()V

    :cond_1
    move-object v6, v7

    .line 293
    .end local v1           #httpParameters:Lorg/apache/http/params/HttpParams;
    .end local v2           #httpRequest:Lorg/apache/http/client/methods/HttpPost;
    .end local v3           #httpResponse:Lorg/apache/http/HttpResponse;
    .end local v4           #params:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    .end local v7           #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v10           #timeoutConnection:I
    .end local v11           #timeoutSocket:I
    .restart local v6       #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    :cond_2
    :goto_1
    return-void

    .line 270
    .end local v6           #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v1       #httpParameters:Lorg/apache/http/params/HttpParams;
    .restart local v2       #httpRequest:Lorg/apache/http/client/methods/HttpPost;
    .restart local v3       #httpResponse:Lorg/apache/http/HttpResponse;
    .restart local v4       #params:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    .restart local v7       #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v8       #resultString:Ljava/lang/String;
    .restart local v9       #status:Ljava/lang/String;
    .restart local v10       #timeoutConnection:I
    .restart local v11       #timeoutSocket:I
    :cond_3
    :try_start_2
    const-string v12, "401"

    invoke-virtual {v12, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v12

    if-eqz v12, :cond_4

    .line 271
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    const/4 v13, 0x0

    invoke-static {v12, v13}, Lcom/netease/newsreader/activity/AccountRegister;->access$10(Lcom/netease/newsreader/activity/AccountRegister;Z)V

    .line 272
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    iget-object v12, v12, Lcom/netease/newsreader/activity/AccountRegister;->registerHandler:Landroid/os/Handler;

    const/16 v13, 0x8

    invoke-virtual {v12, v13}, Landroid/os/Handler;->sendEmptyMessage(I)Z
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_0

    .line 286
    .end local v3           #httpResponse:Lorg/apache/http/HttpResponse;
    .end local v8           #resultString:Ljava/lang/String;
    .end local v9           #status:Ljava/lang/String;
    :catch_0
    move-exception v0

    move-object v6, v7

    .line 287
    .end local v1           #httpParameters:Lorg/apache/http/params/HttpParams;
    .end local v2           #httpRequest:Lorg/apache/http/client/methods/HttpPost;
    .end local v4           #params:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    .end local v7           #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v10           #timeoutConnection:I
    .end local v11           #timeoutSocket:I
    .local v0, e:Ljava/lang/Exception;
    .restart local v6       #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    :goto_2
    :try_start_3
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    iget-object v12, v12, Lcom/netease/newsreader/activity/AccountRegister;->registerHandler:Landroid/os/Handler;

    const/4 v13, 0x7

    invoke-virtual {v12, v13}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    .line 288
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_1

    .line 290
    if-eqz v6, :cond_2

    .line 291
    invoke-virtual {v6}, Lorg/apache/http/impl/client/DefaultHttpClient;->getConnectionManager()Lorg/apache/http/conn/ClientConnectionManager;

    move-result-object v12

    invoke-interface {v12}, Lorg/apache/http/conn/ClientConnectionManager;->shutdown()V

    goto :goto_1

    .line 273
    .end local v0           #e:Ljava/lang/Exception;
    .end local v6           #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v1       #httpParameters:Lorg/apache/http/params/HttpParams;
    .restart local v2       #httpRequest:Lorg/apache/http/client/methods/HttpPost;
    .restart local v3       #httpResponse:Lorg/apache/http/HttpResponse;
    .restart local v4       #params:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    .restart local v7       #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v8       #resultString:Ljava/lang/String;
    .restart local v9       #status:Ljava/lang/String;
    .restart local v10       #timeoutConnection:I
    .restart local v11       #timeoutSocket:I
    :cond_4
    :try_start_4
    const-string v12, "421"

    invoke-virtual {v12, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v12

    if-eqz v12, :cond_6

    .line 274
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    const/4 v13, 0x0

    invoke-static {v12, v13}, Lcom/netease/newsreader/activity/AccountRegister;->access$10(Lcom/netease/newsreader/activity/AccountRegister;Z)V

    .line 275
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    iget-object v12, v12, Lcom/netease/newsreader/activity/AccountRegister;->registerHandler:Landroid/os/Handler;

    const/4 v13, 0x6

    invoke-virtual {v12, v13}, Landroid/os/Handler;->sendEmptyMessage(I)Z
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_0

    goto :goto_0

    .line 289
    .end local v3           #httpResponse:Lorg/apache/http/HttpResponse;
    .end local v8           #resultString:Ljava/lang/String;
    .end local v9           #status:Ljava/lang/String;
    :catchall_0
    move-exception v12

    move-object v6, v7

    .line 290
    .end local v1           #httpParameters:Lorg/apache/http/params/HttpParams;
    .end local v2           #httpRequest:Lorg/apache/http/client/methods/HttpPost;
    .end local v4           #params:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    .end local v7           #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v10           #timeoutConnection:I
    .end local v11           #timeoutSocket:I
    .restart local v6       #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    :goto_3
    if-eqz v6, :cond_5

    .line 291
    invoke-virtual {v6}, Lorg/apache/http/impl/client/DefaultHttpClient;->getConnectionManager()Lorg/apache/http/conn/ClientConnectionManager;

    move-result-object v13

    invoke-interface {v13}, Lorg/apache/http/conn/ClientConnectionManager;->shutdown()V

    .line 292
    :cond_5
    throw v12

    .line 277
    .end local v6           #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v1       #httpParameters:Lorg/apache/http/params/HttpParams;
    .restart local v2       #httpRequest:Lorg/apache/http/client/methods/HttpPost;
    .restart local v3       #httpResponse:Lorg/apache/http/HttpResponse;
    .restart local v4       #params:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    .restart local v7       #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v8       #resultString:Ljava/lang/String;
    .restart local v9       #status:Ljava/lang/String;
    .restart local v10       #timeoutConnection:I
    .restart local v11       #timeoutSocket:I
    :cond_6
    :try_start_5
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    const/4 v13, 0x0

    invoke-static {v12, v13}, Lcom/netease/newsreader/activity/AccountRegister;->access$10(Lcom/netease/newsreader/activity/AccountRegister;Z)V

    .line 278
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    iget-object v12, v12, Lcom/netease/newsreader/activity/AccountRegister;->registerHandler:Landroid/os/Handler;

    const/4 v13, 0x7

    invoke-virtual {v12, v13}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    goto :goto_0

    .line 282
    .end local v8           #resultString:Ljava/lang/String;
    .end local v9           #status:Ljava/lang/String;
    :cond_7
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    const/4 v13, 0x0

    invoke-static {v12, v13}, Lcom/netease/newsreader/activity/AccountRegister;->access$10(Lcom/netease/newsreader/activity/AccountRegister;Z)V

    .line 283
    iget-object v12, p0, Lcom/netease/newsreader/activity/AccountRegister$RegisterHandler;->this$0:Lcom/netease/newsreader/activity/AccountRegister;

    iget-object v12, v12, Lcom/netease/newsreader/activity/AccountRegister;->registerHandler:Landroid/os/Handler;

    const/4 v13, 0x7

    invoke-virtual {v12, v13}, Landroid/os/Handler;->sendEmptyMessage(I)Z
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_0

    goto :goto_0

    .line 289
    .end local v1           #httpParameters:Lorg/apache/http/params/HttpParams;
    .end local v2           #httpRequest:Lorg/apache/http/client/methods/HttpPost;
    .end local v3           #httpResponse:Lorg/apache/http/HttpResponse;
    .end local v4           #params:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    .end local v7           #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v10           #timeoutConnection:I
    .end local v11           #timeoutSocket:I
    .restart local v6       #regclient:Lorg/apache/http/impl/client/DefaultHttpClient;
    :catchall_1
    move-exception v12

    goto :goto_3

    .line 286
    :catch_1
    move-exception v0

    goto :goto_2
.end method
